﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;

namespace Geometry.Service
{
   public class CommonService
    {
       public static void ShowMessage(string message) 
            { 
               //// Cleans the message to allow single quotation marks 
               //string cleanMessage = message.Replace("'", "\'"); 
               //string script = "<script type='text/javascript'>alert('" + cleanMessage + "');</script>"; 

               //// Gets the executing web page 
               //Page page = HttpContext.Current.CurrentHandler as Page; 

               //// Checks if the handler is a Page and that the script isn't allready on the Page 
               //if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert")) 
               //{ 
               //  page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script); 
               //}

                System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE='JavaScript'>alert('" + message + "')</SCRIPT>");
            } 
    }
}
